package com.project.projectdemo.utils;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 返回结果工具类
 * 统一返回格式
 *
 */
public class ResultUtils {
	//成功 
	public static final String SUCCESS="0";
	//失败 
	public static final String FAIL="1";
	
	//不带数据的返回
	public static Map getResultMap(String flat,String msg){
		Map map = new HashMap();
		map.put("flat", flat);
		map.put("msg", msg);
		return map;
	}
	
	//带数据的返回
	public static Map getResultMap(String flat,String msg,Object result){
		Map map = new HashMap();
		map.put("flat", flat);
		map.put("msg", msg);
		map.put("info", result);
		return map;
	}
	
	//带list数据的返回
	public static Map getResultMap(String flat,String msg,List list){
		Map map = new HashMap();
		map.put("flat", flat);
		map.put("msg", msg);
		map.put("list", list);
		return map;
	}
}